package cn.dujc.superkid.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.List;

import cn.dujc.core.adapter.BaseAdapter;
import cn.dujc.core.adapter.BaseViewHolder;
import cn.dujc.superkid.R;
import cn.dujc.superkid.bean.StartRankingResult;

public class StartAdapter extends BaseAdapter<StartRankingResult.RankingBean> {

    public StartAdapter(@Nullable List<StartRankingResult.RankingBean> data) {
        super(data);
        mLayoutResId = R.layout.item_start;
    }

    @Override
    protected void convert(BaseViewHolder helper, StartRankingResult.RankingBean item) {
        helper.setText(R.id.name,item.getUsername()+"");
        helper.setText(R.id.designation,item.getLevel()+"");
        helper.setText(R.id.countAnswer,item.getAnswers_num()+"");
        helper.setText(R.id.countRight,item.getCorrect_answers_num()+"");
        helper.setText(R.id.tv_rank,item.getRanking()+"");
        helper.setText(R.id.countStart,item.getIntegral()+"");
        helper.setText(R.id.countTotal,item.getTotal_answers_num()+"");
    }
}
